package com.wzz.controller;

import com.wzz.pojo.User;
import com.wzz.service.UserService;
import com.wzz.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author DarkClown
 * @date 2024-08-12 09:15
 * @project_name day0812-month
 * @parem
 **/
@RequestMapping("/user/user")
@RestController
public class UserController {
    @Autowired
    UserService userService;

    /**
     * 登录接口
     * @param user
     * @param id
     * @return
     */
    @RequestMapping("/login/{id}")
    private R login(@RequestBody User user, @PathVariable("id")Integer id){
        return userService.login(user,id);
    }

    /**
     * 发送验证码
     * @param user
     * @return
     */
    @RequestMapping("/sendCode")
    private R sendCode(@RequestBody User user){
        return userService.sendCode(user);
    }

    @RequestMapping("updatePassword")
    private R updatePassword(@RequestBody User user){
        return userService.updatePassword(user);
    }

}
